package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-15
 * Time: 17:48
 */
class Student{
    private String name = "xiaobiesan";
    private int age;
    public static String classRoom = "116";

    public Student(){
        System.out.println("不带参数、");
    }
    public Student(String name, int age){
        this.name = name;
        this.age = age;
        System.out.println("带2个参数~");
    }

    public String getName(){
        return name;
    }
    public void setName(){
        this.name = name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(){
        this.age  =age;
    }

    public void print (){
        System.out.println("姓名"+this.name + " 的年龄为："+ this.age);
    }
}

public class Test2 {
    public static void main(String[] args) {
        Student student1 = new Student("zhangsan",21);
        student1.print();
    }
}
